package moonlit.chill.pay.service;

import moonlit.chill.pay.constants.Constants;
import moonlit.chill.pay.vo.TradeParam;
import moonlit.chill.pay.vo.PayResult;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * @author MoonlitChill
 * @date 2024/4/15 15:06
 */
public interface PayStrategy {

    /**
     * 发起支付
     */
    default PayResult<?> payMethod(TradeParam tradeParam){
        PayResult<?> result = new PayResult<>();
        result.error("当前支付方式不支持", Constants.PAY_FAIL_CODE);
        return result;
    }

    /**
     * 支付查询
     */
    default PayResult<?> payForPayQuery(TradeParam tradeParam){
        PayResult<?> result = new PayResult<>();
        result.error("该方式不支持", Constants.PAY_FAIL_CODE);
        return result;
    }

    /**
     * 退款
     */
    default PayResult<?> payForRefund(TradeParam tradeParam){
        PayResult<?> result = new PayResult<>();
        result.error("该方式不支持", Constants.PAY_FAIL_CODE);
        return result;
    }

    /**
     * 退款查询
     */
    default PayResult<?> payForRefundQuery(TradeParam tradeParam){
        PayResult<?> result = new PayResult<>();
        result.error("该方式不支持", Constants.PAY_FAIL_CODE);
        return result;
    }

    /**
     * 异步回调
     */
    default PayResult<?> payForNotify(HttpServletRequest request, HttpServletResponse response){
        PayResult<?> result = new PayResult<>();
        result.error("该方式不支持", Constants.PAY_FAIL_CODE);
        return result;
    }

    /**
     * 支付下载账单
     */
    default PayResult<List<String[]>> payForBill(String date){
        PayResult<List<String[]>> result = new PayResult<>();
        result.error("该方式不支持", Constants.PAY_FAIL_CODE);
        return result;
    }
}
